; 24/11/89

;All the ANYs

COMMAND ANY
PrintMessage 38
TurnFlagOFF 3       ;flute flag off
TurnFlagOFF 5       ;adjacent to pond flag off
TurnFlagOFF 6       ;adjacent to pond (in boat) flag off
TurnFlagOFF 7       ;adjacent to lair flag off
TurnFlagOFF 14      ;valid untie @ top
TurnFlagOFF 21      ;combination ok flag
CounterEquals 1 9   ;she-bear tick
SendToRoom 301 5    ;put she-bear in room
END_COMMAND

COMMAND ANY
CounterEquals 1 20  ;she-bear tick
SwapLocations 301 302 ;put she-bear in limbo and return bear
TurnCounterOFF 1    ;cancel counter
END_COMMAND

;if you pass the ladder, note its room
COMMAND ANY
Present 216 ;inflated
OR
Present 247 ;deflated
MakeVarRoomNum 3
END_COMMAND

;close off UP if ladder recently deflated
COMMAND ANY
FlagON 22
Present 247
TurnFlagOFF 22
ChangePassageway 9 0
END_COMMAND

;set UP if ladder recently inflated
COMMAND ANY
FlagON 23
AtLocation 59
TurnFlagOFF 23
ChangePassageway 9 45
END_COMMAND

;get that thing  (light)
COMMAND ANY
NOT IsCarrying 299
Present 299
GetIt 299
END_COMMAND

;blunder in the dark
COMMAND ANY
NOT LightPresent
VerbIsDirection
Chance 70
PrintMessage 195
DoneWithTurn
END_COMMAND

COMMAND ANY
NOT LightPresent
NOT VerbIsDirection
NOT NounIsNumber 242
PrintMessage 196
DoneWithTurn
END_COMMAND

;put in the dangling rope passageway
COMMAND ANY
AtLocation 33
FlagOFF 15
FlagON 13
FlagOFF 12
TurnFlagON 15
ChangePassageway 10 36
END_COMMAND

;allow the rope to ground passageway
COMMAND ANY
AtLocation 35
FlagOFF 16
FlagOFF 13
FlagON 12
TurnFlagON 16
END_COMMAND

;start the dangle tick
COMMAND ANY
FlagOFF 17
AtLocation 36
ChangePassageway 9 0
TurnFlagON 17
TurnCounterON 3
END_COMMAND

; and spring it
COMMAND ANY
CounterEquals 3 3
TurnCounterOFF 3
GoToRoom 11
END_COMMAND

;various COMMANDs to restrict freedom of manipulation on mat
;to objects held
COMMAND ANY
FlagON 8 
NOT NOUNIsCarrying
OR
NOUNIsNumber 299
PrintMessage 33
TurnFlagOFF 8       ;this allows escape from mat
PrintMessage 34
END_COMMAND

;removal of snake - general
COMMAND ANY
Present 305
CounterEquals 2 4
SendToRoom 305 0
SendToRoom 306 0
RemoveFromGroup 306  ;bye bye fritz
PrintMessage 51
TurnCounterOFF 2
END_COMMAND

;moves distant rusty key from waiting room
;and closes catflap for good
COMMAND ANY
AtLocation 34
IsOpen 220              ;catflap open
NOT IsLocated 230 220   ;key out of catflap
SendToRoom 208 0        ;wire in limbo
CloseIt 220             ;loc up flap
LockIt 220
PrintMessage 48         ;tell 'im
END_COMMAND

COMMAND ANY
AtLocationGT 20
AtLocationLT 30
OR
AtLocation 44
OR 
AtLocation 52
OR
AtLocation 69
TurnFlagON 5        ;next to water flag
AtLocationGT 23
AtLocationLT 27
TurnFlagON 6        ;in boat flag
END_COMMAND

COMMAND ANY
AtLocation 4          ;player adjacent to lair
OR
AtLocation 9
OR
AtLocation 21
TurnFlagON 7
Chance 20
IsLocated 302 5       ;bear in lair
PrintMessage 10       ;bear warning
END_COMMAND

COMMAND ANY
FlagON 7              ;adjacent to lair
Chance 20
IsLocated 301 5       ;she-bear in lair
PrintMessage 11       ;she-bear warning
END_COMMAND

COMMAND ANY
RemoveFromGroup 303   ;move owl about
Chance 10
AddToGroup 303
PutInCurrentRoom 303
END_COMMAND

COMMAND ANY
AtLocation 14
IsOpen 221            ;open iron gate
ChangePassageway 3 31
END_COMMAND

COMMAND ANY
AtLocation 14
NOT IsOpen 221        ;close iron gate
ChangePassageway 3 0
END_COMMAND

; Deal with ghetto blaster
COMMAND ANY
Present 253
NOT NOUNIsNUMBER 253
PrintMessage 76
DoneWithTurn
END_COMMAND

;Deal with cold room stuff
COMMAND ANY
AtLocation 56
CounterEquals 4 0
NOT VerbIsDirection
TurnCounterON 4
PrintMessage 85
DoneWithTurn
END_COMMAND

COMMAND ANY
AtLocation 56
NOT CounterEquals 4 0
RandomMessage 202 204
VerbIsDirection
DoneWithTurn
END_COMMAND

COMMAND ANY
AtLocation 56
NOT Present 252
CounterGT 4 6
PrintMessage 88
GetIt 252
DoneWithTurn
END_COMMAND
;end of cold room

;Eternal flame stuff
;start tick
COMMAND ANY
Present 260        ;torch is here
NOT AtLocation 49  ;but not in hall of ..um
CounterEquals 5 0  ;and the tick hasn't started,
TurnCounterON 5    ;so start it
END_COMMAND

;extinguish flame
COMMAND ANY
Present 260
NOT AtLocation 49
CounterGT 5 15        ; after 15 ticks,
SwapLocations 260 269 ;produce the unlit torch
TurnCounterOFF 5      ;and stop the tick
PrintMessage 94
END_COMMAND

;re-light flame in hall
COMMAND ANY
AtLocation 49         ;in hall
Present 269           ;unlit torch
SwapLocations 260 269 ;produce the eternal flame
PrintMessage 95
END_COMMAND
;end of eternal flame stuff

;Harvey problems
COMMAND ANY
AtLocation 51     ;kennel
NOT IsGroupMember 308 ;Harvey not yet friendly
RandomMessage 104 106
VerbIsDirection
PrintMessage 107
DoneWithTurn
END_COMMAND

;Harvey and the cat
COMMAND ANY
AtLocation 20
Present 313
Present 308
FlagON 30
Destroy 313
PrintMessage 170
END_COMMAND

COMMAND ANY
AtLocation 20
Present 313
Present 308
TurnFlagON 30
PrintMessage 169
END_COMMAND

COMMAND ANYBODY, ANY
NamePresent
PrintMessage 116
DoneWithTurn
END_COMMAND

;fading marks
COMMAND ANY
FlagON 25
VariableGT 5 0
SubtractFromVariable 5 1
VariableEquals 5 0          ;faded out
Destroy 273
Destroy 274
END_COMMAND

COMMAND ANY
FlagON 25
VariableGT 6 0
SubtractFromVariable 6 1
VariableEquals 6 0          ;faded out
Destroy 275
Destroy 276
END_COMMAND

COMMAND ANY
FlagON 25              ;if marks faded and not near mat
NOT AtLocation 60
VariableEquals 5 0
VariableEquals 6 0
SwapLocations 222 277            ;destroy mat
END_COMMAND

; basket stuff
COMMAND ANY
IsCarrying 224  ;wicker basket
Present 306
NOT IsGroupMember 306
AddToGroup 306  ;Sir Fritz
Chance 60
RandomMessage 130 133
END_COMMAND

COMMAND ANY
IsGroupMember 306
Present 306
NOT IsCarrying 224  ;wicker basket
RemoveFromGroup 306  ;Sir Fritz
END_COMMAND

COMMAND ANY
AtLocation 16
Destroy 204
END_COMMAND

;end of the ANY ANY ANYs

; open hall of whatsit door stuff
COMMAND KICK DOOR
Present 256
PrintMessage 79
SendToRoom 256 0
ChangePassageway 4 52 ; open passage West (Dir 4) to pier
DoneWithTurn
END_COMMAND

COMMAND KICK HARVEY
Present 308
PrintMessage 119
DoneWithTurn
END_COMMAND

COMMAND KICK BONE
ReDirectTo THROW BONE
END_COMMAND

COMMAND KICK GORILLA
Present 304
PrintMessage 178
DoneWithTurn
END_COMMAND

COMMAND EXAMINE BLASTER
Present 253
QuitAllCMDs
END_COMMAND

COMMAND EXAMINE BONE
QuitAllCMDs
END_COMMAND

; open hall of whatsit door stuff
COMMAND EXAMINE DOOR
Present 256
QuitAllCMDs
END_COMMAND

COMMAND EXAMINE GORILLA
QuitAllCMDs
END_COMMAND

COMMAND EXAMINE DRAWBRIDGE
QuitAllCMDs
END_COMMAND

COMMAND EXAMINE EAGLES
QuitAllCMDs
END_COMMAND

COMMAND ATTACK GORILLA
Present 304
PrintMessage 178
DoneWithTurn
END_COMMAND

COMMAND ATTACK EAGLES
Present 292
PrintMessage 193
DoneWithTurn
END_COMMAND

;dealing with harvey
COMMAND ATTACK HARVEY
Present 308
PrintMessage 160
DoneWithTurn
END_COMMAND

COMMAND ATTACK BONE
PrintMessage 117
DoneWithTurn
END_COMMAND

COMMAND ATTACK COCKROACHES
PrintMessage 86
DoneWithTurn
END_COMMAND

COMMAND PAT GORILLA
Present 304
RandomMessage 166 168
DoneWithTurn
END_COMMAND

COMMAND PAT EAGLES
Present 292
PrintMessage 193
DoneWithTurn
END_COMMAND

;dealing with harvey
COMMAND PAT HARVEY
Present 308
IsGroupMember 308
RandomMessage 108 109
DoneWithTurn
END_COMMAND

;dealing with harvey
COMMAND PAT HARVEY
NOT Present 308
PrintMessage 12
DoneWithTurn
END_COMMAND

;dealing with harvey
COMMAND SHOOT HARVEY
Present 308
PrintMessage 119
DoneWithTurn
END_COMMAND

COMMAND SHOOT EAGLES
Present 292
PrintMessage 193
DoneWithTurn
END_COMMAND

COMMAND TURN BLASTER
Present 253
SwapLocations 253 254
PrintMessage 77
DoneWithTurn
END_COMMAND

COMMAND TURN BLASTER
Present 254
SwapLocations 253 254
PrintMessage 78
DoneWithTurn
END_COMMAND

; Lights operation
COMMAND TURN PEG
AtLocation 4       ;bearlair (w)
IsLocated 202 203  ;Peg is in round hole
NOUNisNumber 202   ;It's the square one
TurnFlagON 4
PrintMessage 1     ;the light goes out
IsLocated 302 5    ;bear in bearlair (e)
PrintMessage 2     ;the bear leaves
Destroy 302        ;bear to limbo
TurnCounterON 1    ;tick for appearance of she-bear
END_COMMAND

;peg operations
; Lights operation
COMMAND TURN PEG
FlagON 4
IsLocated 301 5    ;she-bear in bearlair (e)
PrintMessage 9     ;the she-bear doesn't leave
END_COMMAND

; Lights operation
COMMAND TURN PEG
FlagON 4
PrintMessage 3     ;the light goes back on
TurnFlagOFF 4
DoneWithTurn
END_COMMAND

; Lift operation go down
COMMAND TURN PEG
AtLocation 30      ;Lift
IsLocated 205 215  ;Round Peg is in square hole
NOUNisNumber 205   ;It's the round one
TurnFlagON 4
GetIt 205          ;give him the round peg
GoToRoom 34        ;go down
SendToRoom 233 34  ;move floor too
FlagOFF 11         ;Not used to it
PrintMessage 44    ;long message
END_COMMAND

; Lift operation go up
COMMAND TURN PEG
AtLocation 34      ;Lift
IsLocated 205 231  ;Round Peg is in rectangular hole
NOUNisNumber 205   ;It's the round one
TurnFlagON 4
GetIt 205          ;give him the round peg
GoToRoom 30        ;go up
SendToRoom 233 30  ;move floor too
FlagOFF 11         ;Not used to it
PrintMessage 45    ;long message
TurnFlagON 11
END_COMMAND

; Lift operation
COMMAND TURN PEG
FlagON 4           ;valid peg turn
FlagOFF 10         ;Lift on top level?
FlagON 11          ;used to it?
PrintMessage 46
END_COMMAND

; Lift operation
COMMAND TURN PEG
FlagON 4           ;valid peg turn
FlagON 10          ;Lift on bottom level?
FlagON 11          ;used to it?
PrintMessage 47
END_COMMAND

; Lift operation final acts
COMMAND TURN PEG
FlagON 4           ;valid peg turn
FlagON 10          ;Lift on bottom level?
TurnFlagOFF 10     ;Lift up
TurnFlagOFF 4
DoneWithTurn
END_COMMAND

; Lift operation final acts
COMMAND TURN PEG
FlagON 4           ;valid peg turn
FlagOFF 10         ;Lift on top level?
TurnFlagON 10      ;Lift down
TurnFlagOFF 4
DoneWithTurn
END_COMMAND
;end of peg operations

;locomotive operations
COMMAND TURN KNOB
Present 212
FlagON 2            ;Brake ON = Flag OFF 
TurnFlagOFF 2
PrintMessage 6
DoneWithTurn
END_COMMAND

;locomotive operations
COMMAND TURN KNOB
Present 212
FlagOFF 2           ;Brake OFF = Flag ON
TurnFlagON 2
PrintMessage 5
DoneWithTurn
END_COMMAND

; broom cupboard door
COMMAND SLIDE DOOR
NOUNIsNumber 270
FlagON 24
CloseIt 270
TurnFlagOFF 24
SendToRoom 271 0
ChangePassageway 2 0
ChangePassageway 11 0
PrintMessage 126
DoneWithTurn
END_COMMAND

; broom cupboard door
COMMAND SLIDE DOOR
NOUNIsNumber 270
FlagOFF 24
OpenIt 270
TurnFlagON 24
SendToRoom 271 63
ChangePassageway 2 63
ChangePassageway 11 63
PrintMessage 126
DoneWithTurn
END_COMMAND

COMMAND SLIDE DOWN ROPE
AtLocation 35
OR
AtLocation 33
OR
AtLocation 36
Present 234
OR
Present 236
OR
Present 237
OR
Present 238
ReDirectTo DOWN
END_COMMAND

COMMAND SLIDE DOWN ROPE
PrintMessage 186
DoneWithTurn
END_COMMAND

;broom cupboard
COMMAND ANY DOOR
NOUNIsNumber 270
RandomMessage 124 125
DoneWithTurn
END_COMMAND
;end of broom cupboard door

; open hall of whatsit door stuff
COMMAND ANY DOOR
Present 256
RandomMessage 80 82
DoneWithTurn
END_COMMAND
;end of door stuff

COMMAND ANY GORILLA
Present 304
RandomMessage 166 168
DoneWithTurn
END_COMMAND

COMMAND ANY BLASTER
Present 253
PrintMessage 76
DoneWithTurn
END_COMMAND

COMMAND ANY EAGLES
Present 292
PrintMessage 193
DoneWithTurn
END_COMMAND

COMMAND ANY FERRET
RandomMessage 101 103
END_COMMAND

; adjustments for walls etc.

COMMAND INVENTORY
DropIt 299
QuitAllCMDs
END_COMMAND

COMMAND DROP FENCE
AtLocation 15
NOUNIsCarrying
DropNOUN
ReDirectTo PUSH FENCE
QuitAllCMDs
END_COMMAND

COMMAND DROP THING
DropIt 299
QuitAllCMDs
END_COMMAND

;at top of ladder
COMMAND DROP ANY
Present 239
NOUNIsCarrying
SendNOUNToItem 216 ;foot of ladder
PrintMessage 64
DoneWithTurn
END_COMMAND

; Drops in elevator
COMMAND DROP ANY
AtLocation 30
OR
AtLocation 34
NOUNIsCarrying
DestroyNOUN
PrintMessage 42
END_COMMAND
 
COMMAND DROP ALL
DropIt 299
QuitAllCMDs
END_COMMAND

COMMAND SMELL
AtLocation 2
OR
AtLocation 4
OR
AtLocation 5
OR
AtLocation 57
OR
AtLocation 51
PrintMessage 180
DoneWithTurn
END_COMMAND

COMMAND SMELL
PrintMessage 181
DoneWithTurn
END_COMMAND

COMMAND SOUTH
AtLocation 41
IsCarrying 281
PrintMessage 148
DoneWithTurn
END_COMMAND

COMMAND HELP
AtLocation 56
Present 252
TurnCounterOFF 4
PrintMessage 87
DoneWithTurn
END_COMMAND

COMMAND READ BOOK
AtLocation 56
Present 252
TurnCounterOFF 4
PrintMessage 87
DoneWithTurn
END_COMMAND

;dealing with harvey
COMMAND THROW BONE
Present 308
RandomMessage 113 115
AddToGroup 308
AddToGroup 309
END_COMMAND

COMMAND THROW BONE
AtLocation 69
Present 308
NOT FlagON 29
NOT FlagON 27
FlagON 28
PrintMessage 163
END_COMMAND

COMMAND THROW BONE
AtLocation 69
Present 308
NOT FlagON 29
FlagON 27
FlagON 28
PrintMessage 161
TurnFlagON 29
END_COMMAND

COMMAND THROW BONE
Present 308
DoneWithTurn
END_COMMAND

COMMAND THROW ROPE
Present 250
AtLocation 69
PrintMessage 164
DoneWithTurn
END_COMMAND

COMMAND THROW STRING
Present 280
AtLocation 69
PrintMessage 165
DoneWithTurn
END_COMMAND

COMMAND GET BONE
PrintMessage 118
DoneWithTurn
END_COMMAND

COMMAND GET THING
PrintMessage 190
DoneWithTurn
END_COMMAND

COMMAND GET ANY
NOUNPresent
MakeVarNounNum 31
VariableGT 31 299
RandomMessage 198 201
DoneWithTurn
END_COMMAND

COMMAND PUSH BONE
PrintMessage 117
DoneWithTurn
END_COMMAND

; end of harvey

COMMAND PUSH GORILLA
Present 304
RandomMessage 166 168
DoneWithTurn
END_COMMAND

; trapdoor stuff
COMMAND PUSH TRAPDOOR
AtLocation 39
Present 240
TurnFlagOFF 18
TurnFlagOFF 19
TurnFlagOFF 20
PrintMessage 57
DoneWithTurn
END_COMMAND

; the combination lock
; case where first press is correct (2)
COMMAND PUSH ANY
AtLocation 39
Present 241
NounToVariable 2
NOT VariableEquals 2 0
PrintMessage 58
FlagOFF 18               ;first press
VariableEquals 2 2
TurnFlagON 19            ;first press was correct
TurnFlagON 18
DoneWithTurn
END_COMMAND

;case where 1st press is wrong
COMMAND PUSH ANY
AtLocation 39
Present 241
NOT VariableEquals 2 0
FlagOFF 18
TurnFlagON 18            ;first press complete
DoneWithTurn
END_COMMAND

;case where first press was right & second press is also right (2)
COMMAND PUSH ANY
AtLocation 39
Present 241
NOT VariableEquals 2 0
FlagON 18                ;2nd press
FlagON 19                ;1st press was correct
FlagOFF 20               ;2nd press not taken
VariableEquals 2 2
PrintMessage 59          ;trapdoor falls etc.
TurnFlagON 21
PlusScore 1
END_COMMAND

; continuation of above
COMMAND PUSH ANY
FlagON 21
SendToRoom 246 37        ;broken trapdoor to floor
SendToRoom 240 0         ; get rid of trapdoor
SendToRoom 241 0
SendToRoom 244 32        ; holes
SendToRoom 245 39
ChangePassageway 9 32    ; up and exit
ChangePassageway 11 32
CloseIt 242
SendToRoom 299 0         ; get rid of thingummy
DoneWithTurn
END_COMMAND

;2nd press following wrong 1st press
;or wrong 2nd press following right 1st
COMMAND PUSH ANY
AtLocation 39
Present 241
NOT VariableEquals 2 0
TurnFlagON 20            ;second press complete
DoneWithTurn
END_COMMAND
;end of trapdoor stuff

;locomotive operations
COMMAND PUSH STICK
Present 211
PrintMessage 4
TurnFlagON  1       ;Forward
DoneWithTurn
END_COMMAND

COMMAND PUSH ANY
NOUNPresent
MakeVarNounNum 31
VariableGT 31 299
RandomMessage 198 201
DoneWithTurn
END_COMMAND

COMMAND LAUNCH GLIDER
ReDirectTo FLY GLIDER
END_COMMAND

;ladder stuff
;insert cartridge
COMMAND INSERT CARTRIDGE
ReDirectTo PUT CARTRIDGE IN SLOT
QuitAllCMDs
END_COMMAND

; Lights operation
COMMAND INSERT PEG IN ANY
ObjectIsNumber 203
OR
ObjectIsNumber 215
OR
ObjectIsNumber 231
RedirectTo PUT PEG IN HOLE
QuitAllCMDs
END_COMMAND

;inflate ladder if cartridge in place and flap closed
;gallery case
COMMAND CLOSE SLOT
InRoom 247 ;collapsed ladder
IsLocated 259 248 ;cart in flap
CloseIt 248
SwapLocations 247 216 ;inflate
SwapLocations 249 259 ;empty cartridge
PrintMessage 92 ;whoosh!
TurnFlagON 23 ; ladder just inflated
AtLocation 54 ;dark room
SendToRoom 239 59 ;toggle to top
ChangePassageway  9 59 ;below gallery
DoneWithTurn
END_COMMAND

;inflate ladder if cartridge in place and flap closed
;NON-gallery case
COMMAND CLOSE SLOT
FlagON 23      ;ladder just inflated
TurnFlagOFF 23 ;don't need info
SendToRoom 239 6 ;toggle to top
ChangePassageway  9 6 ;top of ladder
DoneWithTurn
END_COMMAND

;don't inflate ladder if you're carrying it
COMMAND CLOSE SLOT
IsCarrying 247
DropIt 247
SwapLocations 247 268 ;destroy
PrintMessage 93
DoneWithTurn
END_COMMAND

COMMAND CLOSE HELMET
CloseIt 242
SendToRoom 299 0
DoneWithTurn
END_COMMAND

COMMAND CLOSE DOOR
Present 270
PrintMessage 197
DoneWithTurn
END_COMMAND

; deflate ladder
COMMAND PULL TOGGLE
NOUNPresent
SendToItem 247 216
SendToRoom 216 0
GoToVariableRoom 3
PrintMessage 63
ChangePassageway 10 0
TurnFlagON 22
DoneWithTurn
END_COMMAND

;end of ladder stuff

; fence stuff
COMMAND PULL FENCE
AtLocation 3
ReDirectTo GET FENCE
QuitAllCMDs
END_COMMAND
; end of fence stuff

COMMAND PULL GORILLA
Present 304
RandomMessage 166 168
DoneWithTurn
END_COMMAND

;string stuff
COMMAND PULL ROPE
AtLocation 69
FlagON 29
ChangePassageway 1 70
SwapLocations 282 283
PrintMessage 162
DoneWithTurn
END_COMMAND

;locomotive operations
COMMAND PULL STICK
Present 211
PrintMessage 4
TurnFlagOFF 1       ;Reverse
DoneWithTurn
END_COMMAND

COMMAND PULL LEVER
Present 210
FlagON 2            ;Brake OFF AND
FlagOFF 1           ;Reverse Gear
PrintMessage 7      ;Buffer crash
DoneWithTurn
END_COMMAND

COMMAND PULL LEVER
Present 210
FlagOFF 2           ;Brake ON
PrintMessage 8      ;clouds of steam
DoneWithTurn
END_COMMAND

;end of locomotive

;string stuff

COMMAND TIE STRING TO ROPE
Present 280
Present 250
FlagOFF 27
TurnFlagON 27
SendToItem 280 250
PrintMessage 154
DoneWithTurn
END_COMMAND

COMMAND TIE STRING TO ROPE
Present 280
Present 250
FlagON 27
PrintMessage 155
DoneWithTurn
END_COMMAND

COMMAND TIE STRING TO BONE
Present 280     
Present 309
FlagOFF 28
TurnFlagON 28
PrintMessage 157
DoneWithTurn
END_COMMAND

COMMAND TIE STRING TO BONE
Present 280
Present 309
FlagON 28
SendToItem 280 309
PrintMessage 155
DoneWithTurn
END_COMMAND

COMMAND TIE STRING TO BAMBOO
Present 280
Present 278
OR
Present 279
PrintMessage 159
DoneWithTurn
END_COMMAND

COMMAND TIE STRING TO COATHANGER
Present 280
Present 267
PrintMessage 159
DoneWithTurn
END_COMMAND

COMMAND TIE STRING TO HARVEY
Present 280
Present 308
PrintMessage 160
DoneWithTurn
END_COMMAND

COMMAND TIE STRING TO ANY
Present 280
ObjectPresent
ObjectIsCreature
OR
ObjectIsNumber 264
PrintMessage 158
DoneWithTurn
END_COMMAND

COMMAND TIE STRING TO ANY
Present 280
RandomMessage 150 152
DoneWithTurn
END_COMMAND

COMMAND TIE STRING TO ANY
NOT Present 280       ;string not here
PrintMessage 153
DoneWithTurn
END_COMMAND

COMMAND TIE ANY
PrintMessage 149      ;tie default
DoneWithTurn
END_COMMAND

COMMAND UNTIE STRING FROM ROPE
Present 280
Present 250
TurnFlagOFF 27
PrintMessage 156
DoneWithTurn
END_COMMAND

COMMAND UNTIE STRING FROM BONE
Present 280
Present 309
TurnFlagOFF 28
PrintMessage 156
DoneWithTurn
END_COMMAND

COMMAND UNTIE ROPE
AtLocation 33        ;draughty ledge
FlagOFF 12           ;rope tied at top
TurnFlagON 14        ;valid untie
TurnFlagON 12        ;now untied
PrintMessage 53      ;rope falls away
ChangePassageway 10 0
FlagOFF 13           ;still tied below?
Destroy 234          ;no rope here
SwapLocations 236 238 ;rope @ bottom
DoneWithTurn
END_COMMAND

COMMAND UNTIE ROPE
FlagON 14
Destroy 237          ;rope disappears altogether
DoneWithTurn
END_COMMAND

COMMAND UNTIE ROPE
AtLocation 35
Present 236    ;rope still fixed above
TurnFlagON 13  ;untied
PrintMessage 54
SwapLocations 234 237
Destroy 236
DoneWithTurn
END_COMMAND

COMMAND UNTIE ROPE
AtLocation 35
Present 238    ;rope still here
TurnFlagON 13  ;untied
PrintMessage 55
Destroy 238
DoneWithTurn
END_COMMAND

COMMAND UNTIE SHERPA
Present 312
PrintMessage 134
SwapLocations 312 280
DoneWithTurn
END_COMMAND

COMMAND UNTIE GLIDER
ReDirectTo BREAK GLIDER
END_COMMAND

;ASK stuff
COMMAND TALK TO BO
ReDirectTo EXAMINE BO
QuitAllCMDs
END_COMMAND

COMMAND TALK TO ANY ABOUT ANY
ReDirectTo ASK $NOUN$ ABOUT $OBJECT$
END_COMMAND

COMMAND ASK ANY ABOUT ANY
NOT NOUNPresent
PrintMessage 12    ;Nowhere to be seen
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT ANY
RandomMessage 13 17
END_COMMAND

COMMAND ASK BO ABOUT EGGS
PrintMessage 91
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT PATE
PrintMessage 177
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT PRANG
PrintMessage 18
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT PRINCESS
PrintMessage 176
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT SNAKE
PrintMessage 40
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT ELEVATOR
PrintMessage 52
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT BOAT
PrintMessage 69
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT DOOR
AtLocation 49
PrintMessage 83
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT LADDER
PrintMessage 84
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT COATHANGER
PrintMessage 89
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT COCKROACHES
PrintMessage 90
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT FERRET
PrintMessage 98
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT SNOWMAN
PrintMessage 127
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT SHERPA
PrintMessage 128
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT GLIDER
PrintMessage 147
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT QUEST
PrintMessage 182
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT BAT
PrintMessage 183
DoneWithTurn
END_COMMAND

COMMAND ASK BO ABOUT ANY
PrintMessage 28
DoneWithTurn
END_COMMAND

COMMAND ASK STOREMAN ABOUT CARTRIDGE
PrintMessage 96
DoneWithTurn
END_COMMAND

COMMAND ASK STOREMAN ABOUT ANY
PrintMessage 97
DoneWithTurn
END_COMMAND

COMMAND ASK FRITZ ABOUT ANY
RandomMessage 65 67
DoneWithTurn
END_COMMAND

COMMAND ASK ANY ABOUT ANY
PrintMessage 20
DoneWithTurn
END_COMMAND

;end of ASK

;odds & sods
COMMAND EAT EGGS
Present 262
PrintMessage 91
END_COMMAND

COMMAND FIND ANY
PrintMessage 30    ;find it yourself
DoneWithTurn
END_COMMAND

COMMAND UNLOCK DOOR
Present 256
OR
Present 270
RandomMessage 80 82
DoneWithTurn
END_COMMAND

COMMAND OPEN DOOR
Present 256
OR
Present 270
PrintMessage 194
DoneWithTurn
END_COMMAND

;Snake stuff
COMMAND OPEN BASKET
Present 224
FlagOFF 9          ;snake not out yet?
TurnFlagON 9
PutInCurrentRoom 305  ;fetch the snake
TurnCounterON 2
PrintMessage 39
END_COMMAND 

COMMAND OPEN BASKET
AtLocation 61      ;mountain top
Present 224
Present 305
SendToRoom 305 0   ;snake
SendToRoom 306 0   ;sir fritz
SendToRoom 311 0   ;ab snowman
RemoveFromGroup 306  ;bye bye fritz
PrintMessage 129
END_COMMAND 

COMMAND OPEN HELMET
GetIt 299
PrintMessage 62 
END_COMMAND

; catch fish

COMMAND FISH ANY
ReDirectTo USE NET
END_COMMAND

; Rock marking stuff
COMMAND MARK ROCK WITH CHALK
ReDirectTo USE CHALK
END_COMMAND

COMMAND MARK ROCK WITH PAINT
ReDirectTo USE PAINT
END_COMMAND

COMMAND WRITE ANY WITH CHALK
ReDirectTo USE CHALK
END_COMMAND

COMMAND WRITE ANY WITH PAINT
ReDirectTo USE PAINT
END_COMMAND

COMMAND WRITE ANY
ReDirectTo USE CHALK
END_COMMAND

COMMAND PAINT ANY
ReDirectTo USE PAINT
END_COMMAND

COMMAND GO ON DOORMAT
ReDirectTo USE DOORMAT
END_COMMAND

COMMAND SWIM
FlagON 5           ;adjacent to pond
GoToRoom 22
DoneWithTurn
END_COMMAND

COMMAND SWIM
PrintMessage 31
DoneWithTurn
END_COMMAND

COMMAND PADDLE ANY
FlagON 6		  ;in boat
PrintMessage 32
DoneWithTurn
END_COMMAND

COMMAND PUT ANY IN CATFLAP
AtLocation 30
IsOpen 220
PrintMessage 49
DoneWithTurn
END_COMMAND

COMMAND JUMP
PrintMessage 50
DoneWithTurn
END_COMMAND

COMMAND CLIMB ROPE
PrintMessage 186
DoneWithTurn
END_COMMAND

COMMAND CLIMB UP ROPE
PrintMessage 186
DoneWithTurn
END_COMMAND

COMMAND CLIMB LADDER
ReDirectTo UP
QuitAllCMDs
END_COMMAND

COMMAND SWING
AtLocation 36
PrintMessage 179
DoneWithTurn
END_COMMAND

;going down rope to beach
COMMAND DOWN
AtLocation 35
Present 238
GoToRoom 38
PrintMessage 68
SendToRoom 250 38
DoneWithTurn
END_COMMAND

COMMAND CUT ANY
PrintMessage 56
DoneWithTurn
END_COMMAND

COMMAND REMOVE THING
DropIt 299
QuitAllCMDs
END_COMMAND

COMMAND REMOVE ANY
NOUNIsWearing
PrintMessage 60
DoneWithTurn
END_COMMAND

COMMAND WEAR ANY
PrintMessage 61
DoneWithTurn
END_COMMAND

;all the GIVEs
;default give

GIVE ANY TO ANY
NOT ObjectPresent
PrintMessage 110
DoneWithTurn
END_COMMAND

GIVE ANY TO ANY
NOT NOUNIsCarrying
PrintMessage 111
DoneWithTurn
END_COMMAND

COMMAND GIVE ANY TO HARVEY
IsGroupMember 308
RandomMessage 108 109
END_COMMAND

;swap new cartridges for old
COMMAND GIVE ANY TO STOREMAN
NounIsNumber 249
PrintMessage 99
SwapLocations 249 259
DoneWithTurn
END_COMMAND

COMMAND GIVE ANY TO STOREMAN
PrintMessage 100
DoneWithTurn
END_COMMAND

COMMAND GIVE ANY TO CAT
NounIsNumber 285
PrintMessage 175
Destroy 285
DoneWithTurn
END_COMMAND

COMMAND GIVE ANY TO CAT
PrintMessage 37
DoneWithTurn
END_COMMAND

COMMAND GIVE SWORD TO GUARD
SendToRoom 307 0
SendToRoom 201 0
PrintMessage 74
DoneWithTurn
END_COMMAND

COMMAND GIVE BASKET TO FRITZ
PrintMessage 135
DoneWithTurn
END_COMMAND

COMMAND GIVE ANY TO ANY
RandomMessage 71 73
DoneWithTurn
END_COMMAND

; Building the hanglider
COMMAND BUILD GLIDER
NOT AtLocation 58           ;fully equipped workshop
PrintMessage 136
DoneWithTurn
END_COMMAND

COMMAND BUILD GLIDER
TurnFlagON 26               ;it's OK to build
NOT Present 227
PrintMessage 137
TurnFlagOFF 26
END_COMMAND

COMMAND BUILD GLIDER
NOT Present 251
PrintMessage 138
TurnFlagOFF 26
END_COMMAND

COMMAND BUILD GLIDER
NOT Present 279
PrintMessage 139
TurnFlagOFF 26
END_COMMAND

COMMAND BUILD GLIDER
NOT Present 280
PrintMessage 140
TurnFlagOFF 26
END_COMMAND

COMMAND BUILD GLIDER
FlagOFF 26
DoneWithTurn
END_COMMAND

COMMAND BUILD GLIDER
FlagON 26
NOT Present 267
PrintMessage 141
TurnFlagOFF 26
DoneWithTurn
END_COMMAND

COMMAND BUILD GLIDER
FlagON 26
Destroy 251
Destroy 279
Destroy 280
Destroy 267
PutInCurrentRoom 281
PrintMessage 142
TurnFlagOFF 26
DoneWithTurn
END_COMMAND

COMMAND BREAK GLIDER
Present 281
PutInCurrentRoom 251
PutInCurrentRoom 279
PutInCurrentRoom 280
PutInCurrentRoom 267
Destroy 281
PrintMessage 143
DoneWithTurn
END_COMMAND

COMMAND USE NET
AtLocation 52
Present 257
Chance 75
RandomMessage 173 174
DoneWithTurn
END_COMMAND

COMMAND USE NET
AtLocation 52
Present 257
NOT Present 285
PutInCurrentRoom 285   ;fish
PrintMessage 171
DoneWithTurn
END_COMMAND

COMMAND USE NET
AtLocation 52
Present 257
PrintMessage 172
DoneWithTurn
END_COMMAND

COMMAND USE CHALK
AtLocation 60        ;rocky shore
IsCarrying 209
Present 222          ;doormat
PutInCurrentRoom 273 ;mark nr mat
SetVariableTo 5 3
END_COMMAND

COMMAND USE CHALK
AtLocation 60        ;rocky shore
IsCarrying 209
NOT Present 222      ;doormat
PutInCurrentRoom 274 ;mark
SetVariableTo 5 3
END_COMMAND

COMMAND USE CHALK
IsCarrying 209    ;PLAY DESCR
PrintMessage 187
DoneWithTurn
END_COMMAND

COMMAND USE CHALK
NOT IsCarrying 209    ;catch-all
PrintMessage 185
DoneWithTurn
END_COMMAND

COMMAND USE PAINT
AtLocation 60        ;rocky shore
IsCarrying 272
Present 222          ;doormat
PutInCurrentRoom 275 ;mark nr mat
SetVariableTo 6 14
END_COMMAND

COMMAND USE PAINT
AtLocation 60        ;rocky shore
IsCarrying 272
NOT Present 222      ;doormat
PutInCurrentRoom 276 ;mark
SetVariableTo 6 14
END_COMMAND

COMMAND USE PAINT
IsCarrying 272       ;PLAY DESCR
PrintMessage 188
DoneWithTurn
END_COMMAND

COMMAND USE PAINT
NOT IsCarrying 272    ;catch-all
PrintMessage 185
DoneWithTurn
END_COMMAND

; end of rock marking stuff
;flute stuff
COMMAND PLAY FLUTE
NOT IsCarrying 223  ;haven't got it
PrintMessage 35
DoneWithTurn
END_COMMAND

COMMAND PLAY FLUTE
TONE 261 200        ;tune and cheeky message
TONE 522 200
TONE 261 200
TONE 522 200
TONE 261 400
RandomMessage 21 23
Present 222         ;and mat present
TurnFlagON 3
END_COMMAND

COMMAND PLAY FLUTE
Present 234
OR
Present 236
OR
Present 237
OR
Present 238
OR
Present 250
PrintMessage 70
END_COMMAND

;untenanted mat in waiting room
COMMAND PLAY FLUTE
FlagON 3               ;valid play
FlagOFF 8              ;not on mat
AtLocation 31
SendToRoom 222 13      ;short move 
PrintMessage 27        ;mat zooms off
DoneWithTurn
END_COMMAND

;untenanted mat in corridor
COMMAND PLAY FLUTE
FlagON 3               ;valid play
FlagOFF 8              ;not on mat
AtLocation 13
SendToRoom 222 31      ;short move 
PrintMessage 27        ;mat zooms off
DoneWithTurn
END_COMMAND

;untenanted mat anywhere else
COMMAND PLAY FLUTE
FlagON 3               ;valid play
FlagOFF 8              ;not on mat
PrintMessage 27        ;mat zooms off
PrintMessage 120       ;goodbye
SendToRoom 222 13      ;goodbye mat
DoneWithTurn
END_COMMAND

;tenanted mat in corridor or w/room
COMMAND PLAY FLUTE
FlagON 3               ;valid play
FlagON 8               ;on mat
PrintMessage 36        ;mat zooms off
AtLocation 31
OR
AtLocation 13
SetVariableTo 4 60     ;mystery tour
SendToRoom 222 60
GoToRoom 60
TurnFlagON 25          ;at rocky shore
DoneWithTurn
END_COMMAND

;adjust cyclic destination
COMMAND PLAY FLUTE
FlagON 3               ;valid play
FlagON 8               ;on mat
TurnFlagOFF 25         ;not at rocky shore
AddToVariable 4 1
VariableEquals 4 64
SetVariableTo 4 60
END_COMMAND

;cyclic tour
COMMAND PLAY FLUTE
FlagON 3               ;valid play
FlagON 8               ;on mat
RandomMessage 121 123  ;mat zooms off
GoToVariableRoom 4     ;cyclic tour
SendToVariableRoom 222 4  ;mat joins us
VariableEquals 4 60
TurnFlagON 25          ;at rocky shore
DoneWithTurn
END_COMMAND

;finally no more on flute
COMMAND PLAY FLUTE
PrintMessage 41
DoneWithTurn
END_COMMAND
; end of flute stuff

COMMAND USE GORILLA
Present 304
RandomMessage 166 168
DoneWithTurn
END_COMMAND

COMMAND USE DOORMAT
NOUNPresent
TurnFlagON 8
END_COMMAND

COMMAND USE GLIDER
ReDirectTo FLY GLIDER
END_COMMAND

COMMAND FLY ANY
NOT IsCarrying 281   ;NOT got hg
PrintMessage 146
DoneWithTurn
END_COMMAND

COMMAND FLY ANY
AtLocation 42    ;canyon
IsCarrying 281   ;got hg
GoToRoom 38      ;on the beach
SendToRoom 308 38 ;send dog
SendToRoom 309 38 ;&bone
PrintMessage 145
DoneWithTurn
END_COMMAND

COMMAND FLY ANY
AtLocation 43    ;clifftop
IsCarrying 281   ;got hg
GoToRoom 67      ;on the road
SendToRoom 308 67 ;send dog
SendToRoom 309 67 ;&bone
PrintMessage 144
DoneWithTurn
END_COMMAND

COMMAND LIGHT ANY
PrintMessage 189
DoneWithTurn
END_COMMAND

COMMAND EXTINGUISH ANY
PrintMessage 190
DoneWithTurn
END_COMMAND

COMMAND FOLLOW ANY
PrintMessage 191
DoneWithTurn
END_COMMAND

COMMAND BURN ANY
PrintMessage 192
DoneWithTurn
END_COMMAND

; COMMAND DEBUG
; ToggleFlag 0
; DoneWithTurn
; END_COMMAND
